.vf-matrix-table,
.vf-grid-table {
  &.is-stretch {
    align-items: stretch;
  }

  .vf-matrix-container {
    
  }

  .vf-matrix-grid {
    border-right: var(--vf-border-width-table) solid var(--vf-border-color-table);
    border-bottom: var(--vf-border-width-table) solid var(--vf-border-color-table);
    gap: 0 !important;
  }

  .vf-matrix-header-first,
  .vf-matrix-header,
  .vf-matrix-header-remove,
  .vf-matrix-row-label,
  .vf-matrix-cell,
  .vf-matrix-row-remove {
    border-left: var(--vf-border-width-table) solid var(--vf-border-color-table);
    border-top: var(--vf-border-width-table) solid var(--vf-border-color-table);
  }

  .vf-matrix-header {
    &.is-sticky {
      border-bottom: var(--vf-border-width-table) solid var(--vf-border-color-table);
    }
  }

  .vf-matrix-row-label {
    &.is-sticky {
      border-right: var(--vf-border-width-table) solid var(--vf-border-color-table);
    }
  }

  .vf-matrix-header-first,
  .vf-matrix-header,
  .vf-matrix-header-remove,
  .vf-matrix-row-label {
    background: var(--vf-bg-table-header);
    color: var(--vf-color-table-header);
  }

  .vf-matrix-row-remove {
    background: var(--vf-bg-table-header);
  }

  .vf-matrix-cell {
    background: var(--vf-bg-input);
  }

  .vf-matrix-header {
    &.is-sticky {
      margin-bottom: calc(var(--vf-border-width-table) * -1);
    }

    &.is-not-sticky {
      border-bottom-width: 0;
    }
  }

  .vf-matrix-row-label {
    
    &.is-sticky {
      margin-right: calc(var(--vf-border-width-table) * -1);
    }
    
    &.is-not-sticky {
      border-right-width: 0;
    }
  }

  .vf-matrix-cell-wrapper {
    &.has-padding {
      padding-left: 0;
      padding-right: 0;
    }

    &.is-stretch {
      align-items: stretch;
    }

    &.has-error {
      position: relative;

      &:after {
        content: '';
        position: absolute;
        inset: 0px;
        box-shadow: inset 0 0 0 1px var(--vf-danger);
        pointer-events: none;
      }
    }
  }

  .vf-matrix-remove-icon {
    
  }

  .vf-matrix-header-first {
    
  }

  .vf-matrix-row-label {
    padding-left: 0.5rem;
  }

  .vf-grid {
    border-right: var(--vf-border-width-table) solid var(--vf-border-color-table);
    border-bottom: var(--vf-border-width-table) solid var(--vf-border-color-table);
    gap: 0;
  }

  .vf-grid-cell {
    border-left: var(--vf-border-width-table) solid var(--vf-border-color-table);
    border-top: var(--vf-border-width-table) solid var(--vf-border-color-table);
    background: var(--vf-bg-input);
  }

  /* Layout */

  .vf-matrix-cell-wrapper > .vf-element-layout > .vf-element-layout-outer-wrapper > .vf-layout-inner-container {
    & > .vf-layout-inner-wrapper-before,
    & > .vf-layout-inner-wrapper-after {
      display: none;
    }
  }
  
  .vf-layout-inner-wrapper,
  .vf-element-layout-outer-wrapper {
    height: 100%;
  }
  
  /* Text inputs */

  .vf-input-group {
    border: 0;
    border-radius: 0;
    height: 100%;

    &.vf-input-group-focused {
      position: relative;
      z-index: 1;
    }

    &.vf-input-group-sm {
      height: 100%;
    }
  }

  .vf-input {
    height: 100%;
  }

  /* Native select */

  .vf-native-select {
    height: 100%;
    border: 0;
    border-radius: 0;

    &:focus {
      position: relative;
      z-index: 1;
    }
  }

  .vf-native-select-wrapper {
    height: 100%;
  }

  .vf-native-select-caret {
    z-index: 2;
  }

  /* Select */

  .vf-multiselect {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  /* Native multiselect */

  .vf-multiselect-active {
    position: relative;
    z-index: 1;
  }

  .vf-multiselect-wrapper {
    height: 100%;
  }

  .vf-native-multiselect {
    height: 100%;
    border: 0;
    border-radius: 0;

    &:focus {
      position: relative;
      z-index: 1;
    }
  }

  .vf-native-multiselect-wrapper {
    height: 100%;
  }

  /* Editor */

  .vf-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;

    &.vf-editor-focused {
      position: relative;
      z-index: 1;
    }
  }

  trix-editor {
    height: 100%;
  }

  /* Tabs */

  .vf-checkboxgroup-view-default,
  .vf-radiogroup-view-default {
    padding: 0.25rem 0.5rem;
  }

  .vf-checkboxgroup-tabs-wrapper,
  .vf-radiogroup-tabs-wrapper {
    height: 100%;
    border-radius: 0;
  }

  .vf-checkbox-tabs,
  .vf-radio-tabs {
    border-width: 0;
    border-left-width: var(--vf-border-width-input-t);
  }

  .vf-checkbox-tabs.vf-checkbox-tabs-first,
  .vf-radio-tabs.vf-radio-tabs-first {
    border: 0;
  }

  .vf-checkbox-tabs.vf-checkbox-tabs-first,
  .vf-checkbox-tabs.vf-checkbox-tabs-last,
  .vf-radio-tabs.vf-radio-tabs-first,
  .vf-radio-tabs.vf-radio-tabs-last {
    border-radius: 0;
  }

  /* Blocks */

  .vf-checkbox-blocks,
  .vf-radio-blocks {
    border-width: 0;
    min-height: 100%;
  }

  .vf-checkbox-blocks:not(.vf-checkbox-blocks-first),
  .vf-radio-blocks:not(.vf-radio-blocks-first) {
    border-top-width: var(--vf-border-width-input-t);
  }

  .vf-checkboxgroup-blocks-wrapper,
  .vf-radiogroup-blocks-wrapper {
    height: 100%;
    border-radius: 0;
  }

  .vf-checkbox-blocks-container,
  .vf-radio-blocks-container {
    flex: 1;
  }

  .vf-checkbox-blocks.vf-checkbox-blocks-first,
  .vf-checkbox-blocks.vf-checkbox-blocks-last,
  .vf-radio-blocks.vf-radio-blocks-first,
  .vf-radio-blocks.vf-radio-blocks-last {
    border-radius: 0;
  }

  /* Slider */

  .vf-slider-wrapper {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
  }

  .vf-slider-target {
    width: 100%;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  /* Slider */

  .vf-grid,
  .vf-matrix-grid {
    .vf-btn {
      width: 100%;
      border-radius: 0;

      &:hover:not(:disabled):not(.vf-btn-loading) {
        transform: none;
        filter: brightness(0.95);
      }

      &:focus {
        position: relative;
        z-index: 1;
      }
    }
  }

  /* Static */

  .vf-static {
    height: 100%;
  }

  /* File previews */

  .vf-file-preview-wrapper,
  .vf-file-preview-image-wrapper,
  .vf-file-preview-gallery-wrapper {
    padding: 0.25rem;
  }

  .vf-multifile-list {
    margin-top: 0;
  }
}

.vf-grid-table {
  .vf-grid-field-wrapper > .vf-element-layout > .vf-element-layout-outer-wrapper > .vf-layout-inner-container {
    & > .vf-layout-inner-wrapper-before,
    & > .vf-layout-inner-wrapper-after {
      display: none;
    }
  }

  .vf-grid-field-wrapper .vf-label {
    display: none;
  }

  .vf-static,
  .vf-static-tag,
  .vf-checkbox-wrapper,
  .vf-radio-wrapper,
  .vf-toggle-wrapper {
    padding: var(--vf-py-input) var(--vf-px-input);
  }

  .vf-static-sm,
  .vf-static-tag-sm,
  .vf-checkbox-wrapper-sm,
  .vf-radio-wrapper-sm,
  .vf-toggle-wrapper-sm {
    padding: var(--vf-py-input-sm) var(--vf-px-input-sm);
  }

  .vf-static-lg,
  .vf-static-tag-lg,
  .vf-checkbox-wrapper-lg,
  .vf-radio-wrapper-lg,
  .vf-toggle-wrapper-lg {
    padding: var(--vf-py-input-lg) var(--vf-px-input-lg);
  }

  .vf-signature {
    border: none;
    border-radius: 0;
  }
}